<template>
	<view class="article">
		<div class="title">{{data.title}}</div>
		<rich-text :nodes="data.html"></rich-text>
	</view>
</template>

<script>
	const db = wx.cloud.database()
	export default {
		data() {
			return {
				data:{
					
				}
			}
		},
		methods: {
			
		},onLoad(a) {
			if(a.id){
				console.log(a.id)
				db.collection('article').where({
					_id:a.id
				}).get().then((res)=>{
					this.data=res.data[0]
				})
				
			}else{
				this.data=getApp().globalData.nowarticle
			}
			
		}
		
	}
</script>

<style >
.article{
	line-height: 60rpx;
	padding: 20rpx 30rpx;
}
.title{
	text-align: center;
	font-size: 50rpx;
	line-height: 1.5em;
	padding-bottom: 30rpx;
	border-bottom: 1px solid #eee;
	margin-bottom: 10rpx;
}
</style>
